﻿<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="EditGroupUser.aspx.vb" Inherits="Training.EditGroupUser" %>

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Training - Training:: Edit Group User</title>
<link rel="Stylesheet" type="text/css" media="screen" href="../css/adminStyle.css" />
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <div class="ctr">
        <h2>Edit Group User Information</h2>
        
        <div style="width:750px;text-align:left;margin:0 auto;" class="text">
            <fieldset>
                <legend>User Information</legend>
                <p>Fields in <span class="req"> &nbsp; red &nbsp; </span>&nbsp; are required.</p>
                <asp:Label ID="lblInfoMsg" runat="server" Text="" CssClass="Alert"></asp:Label>
                
                <div class="row">
                    <div class="half">
                        First Name:<asp:RequiredFieldValidator ID="rfFname" 
                            runat="server" ErrorMessage="required" ControlToValidate="tbFname" 
                            CssClass="small" Display="Dynamic" ValidationGroup="info"></asp:RequiredFieldValidator>
                        <br />
                        <asp:TextBox ID="tbFname" CssClass="req" Width="200px" 
                            runat="server" ValidationGroup="info"></asp:TextBox>
                    </div>
                    <div class="half">
                        Last Name:<asp:RequiredFieldValidator ID="rfLname" 
                            runat="server" ErrorMessage="required" ControlToValidate="tbLname" 
                            CssClass="small" Display="Dynamic" ValidationGroup="info"></asp:RequiredFieldValidator>
                        <br />
                        <asp:TextBox ID="tbLname" CssClass="req" Width="200px" 
                            runat="server" ValidationGroup="info"></asp:TextBox>
                    </div>
                    <div class="clr"></div>
                </div>
                
                <div class="row">
                    <div class="half">
                        Address:<br />
                        <asp:TextBox ID="tbAddress" CssClass="formfield" Width="200px" 
                            runat="server" ValidationGroup="info"></asp:TextBox>
                    </div>
                    <div class="half">
                        City:<br />
                        <asp:TextBox ID="tbCity" CssClass="formfield" Width="200px" 
                            runat="server" ValidationGroup="info"></asp:TextBox>
                    </div>
                    <div class="clr"></div>
                </div>
                
                <div class="row">
                    <div class="half">
                        State:<br />
                        <asp:DropDownList ID="ddlState" runat="server" CssClass="formfield" 
                            DataSourceID="dsStates" DataTextField="StateAbbr" 
                            DataValueField="StateId" ValidationGroup="info" 
                            AppendDataBoundItems="True">
                            <asp:ListItem Value="-1" Text="-select-"></asp:ListItem>
                        </asp:DropDownList>
                    </div>
                    <div class="half">
                        Zip:<br />
                        <asp:TextBox ID="tbZip" CssClass="formfield" Width="200px" 
                            runat="server" ValidationGroup="info"></asp:TextBox>
                    </div>
                    <div class="clr"></div>
                </div>
                
                <div class="row">
                    <div class="half">
                        Phone:<br />
                        <asp:TextBox ID="tbPhone" CssClass="formfield" Width="200px" 
                            runat="server" ValidationGroup="info"></asp:TextBox>
                    </div>
                    <div class="half">
                        Email:<asp:RequiredFieldValidator ID="rfEmail" runat="server" 
                            ErrorMessage="required" ControlToValidate="tbEmail" CssClass="small" 
                            Display="Dynamic" ValidationGroup="info"></asp:RequiredFieldValidator><br />
                        <asp:TextBox ID="tbEmail" CssClass="req" Width="200px" 
                            runat="server" ValidationGroup="info"></asp:TextBox>
                    </div>
                    <div class="clr"></div>
                </div>
                
                <div class="row">
                    <div class="half">
                        Group:<br />
                        <asp:DropDownList ID="ddlGroup" CssClass="formfield" runat="server" 
                            DataSourceID="dsGroups" DataTextField="GroupName" 
                            DataValueField="GroupID" ValidationGroup="info">
                        </asp:DropDownList>
                    </div>
                    <div class="half">
                        Active:<br />
                        <asp:RadioButtonList ID="rblActive" runat="server" 
                            RepeatDirection="Horizontal" RepeatLayout="Flow" ValidationGroup="info">
                            <asp:ListItem Value="1" Text="Yes"></asp:ListItem>
                            <asp:ListItem Value="0" Text="No"></asp:ListItem>
                        </asp:RadioButtonList>
                    </div>
                    <div class="clr"></div>
                </div>
                
                <div class="row">
                    <div class="half">
                        Site Code:<br />
                        <asp:TextBox ID="tbSiteCode" CssClass="formfield" Width="200px" 
                            runat="server" ValidationGroup="info"></asp:TextBox><br />
                        <span class="small">(if applicable)</span>
                    </div>
                    <div class="half">&nbsp;</div>
                    <div class="clr"></div>
                </div>
                
                <div class="ctr" style="margin-bottom:4px;">
                    <asp:Button ID="btnUserInfo" runat="server" Text="Update User Info" 
                    CssClass="button" ValidationGroup="info" />
                </div>
            </fieldset>
            
            <br /><br />
            
            <fieldset>
                <legend>Login Information</legend>
                
                <asp:Label ID="lblLoginMsg" runat="server" Text="" CssClass="Alert"></asp:Label>
                
                <div class="row">
                    <div class="half">
                        Login Name:<br />
                        <b><asp:Label ID="lblLogin" runat="server" Text=""></asp:Label></b>
                    </div>
                    <div class="half">&nbsp;</div>
                    <div class="clr"></div>
                </div>
                
                 <div class="row">
                    <asp:CheckBox ID="cbPassword" Text="Check to change password" 
                        runat="server" AutoPostBack="true" CausesValidation="false" />
                    <div class="half">
                        Password:<asp:RequiredFieldValidator ID="rfPasword" runat="server"
                            ErrorMessage="required" ControlToValidate="tbPass" 
                            ValidationGroup="login" CssClass="small" Display="Dynamic" Enabled="false"></asp:RequiredFieldValidator><br />
                        <asp:TextBox ID="tbPass" CssClass="formfield" Width="200px" 
                        runat="server" TextMode="Password" ValidationGroup="login" Enabled="false"></asp:TextBox>
                        <cc1:PasswordStrength ID="tbPass_PasswordStrength" runat="server" 
                            Enabled="True" TargetControlID="tbPass" MinimumNumericCharacters="0" 
                            MinimumSymbolCharacters="0" 
                            MinimumUpperCaseCharacters="0" 
                            MinimumLowerCaseCharacters="0" 
                            PreferredPasswordLength="6" DisplayPosition="LeftSide">
                        </cc1:PasswordStrength>
                    </div>
                    <div class="half">
                        Confirm Password:<asp:RequiredFieldValidator ID="rfPassConf" runat="server"
                            ErrorMessage="required" ControlToValidate="tbPConf" 
                            ValidationGroup="login" CssClass="small" Display="Dynamic" Enabled="false"></asp:RequiredFieldValidator>
                            <asp:CompareValidator ID="cvPass" runat="server" ControlToCompare="tbPass" 
                            ControlToValidate="tbPConf" CssClass="small" Display="Dynamic" 
                            ErrorMessage="password does not match" Enabled="false" ValidationGroup="login"></asp:CompareValidator><br />
                        <asp:TextBox ID="tbPConf" CssClass="formfield" Width="200px" 
                        runat="server" TextMode="Password" ValidationGroup="login" Enabled="false"></asp:TextBox>
                    </div>
                    <div class="clr"></div>
                </div>
                
                <div class="row">
                    <asp:CheckBox ID="cbEmail" Text="Check to change email" 
                        runat="server" AutoPostBack="true" CausesValidation="false" />
                    <div class="half">
                        Email:<asp:RequiredFieldValidator ID="rfLEmail" runat="server"
                            ErrorMessage="required" ControlToValidate="tbLEmail" 
                            ValidationGroup="login" CssClass="small" Display="Dynamic" Enabled="false"></asp:RequiredFieldValidator>
                        <asp:RegularExpressionValidator ID="reLEmail" runat="server" 
                            ErrorMessage="invalid email" ValidationGroup="login" Display="Dynamic" CssClass="small" 
                            ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" 
                            Enabled="false" ControlToValidate="tbLEmail"></asp:RegularExpressionValidator>
                            <br />
                        <asp:TextBox ID="tbLEmail" CssClass="formfield" Width="200px" 
                        runat="server" ValidationGroup="login" Enabled="false"></asp:TextBox>
                    </div>
                    <div class="half">
                        Confirm Email:<asp:RequiredFieldValidator ID="rfEConf" runat="server"
                            ErrorMessage="required" ControlToValidate="tbEConf" 
                            ValidationGroup="login" CssClass="small" Display="Dynamic" Enabled="false"></asp:RequiredFieldValidator>
                            <asp:CompareValidator ID="cvEmail" runat="server" ControlToCompare="tbLEmail" 
                            ControlToValidate="tbEConf" CssClass="small" Display="Dynamic" 
                            ErrorMessage="email does not match" Enabled="false" ValidationGroup="login"></asp:CompareValidator>
                        <br />
                        <asp:TextBox ID="tbEConf" CssClass="formfield" Width="200px" 
                        runat="server" ValidationGroup="login" Enabled="false"></asp:TextBox>
                    </div>
                    <div class="clr"></div>
                </div>
            
                <div class="ctr" style="margin-bottom:4px;">
                    <asp:Button ID="btnLoginInfo" runat="server" Text="Update Login Info" 
                    CssClass="button" ValidationGroup="login" />
                </div>
            </fieldset>
        </div>
        
        <p><a href="Users.aspx">Manage Group Users</a> &nbsp; - &nbsp; 
        <a href="Default.aspx">Admin Main</a></p>
    </div>
    
    <!-- data sources -->
    <asp:SqlDataSource ID="dsStates" runat="server" 
        ConnectionString="<%$ ConnectionStrings:Conn %>" 
        SelectCommand="SELECT [StateId], [StateAbbr] FROM [States]"></asp:SqlDataSource>
        
    <asp:SqlDataSource ID="dsGroups" runat="server" 
        ConnectionString="<%$ ConnectionStrings:Conn %>" 
        SelectCommand="SELECT [GroupID], [GroupName] FROM [Groups] ORDER BY [GroupName]"></asp:SqlDataSource>
    </form>
</body>
</html>
